﻿package com.ufenlei.LTS{
	import com.ufenlei.tool.RoundRectangle;
	
	import flash.display.DisplayObject;
	import flash.filters.DropShadowFilter;

	public class RoundRectBody extends Body {
		private var roundRectBodyWidth:int;
		private var roundRectBodyHeight:int;
		private var ellipseWidth:int;
		private var ellipseHeight:int;
		private var roundRect:RoundRectangle;
		public function RoundRectBody(RRW:int = 0,RRH:int = 0,EW:int = 0,EH:int = 0,isShadow:Boolean = true, alp:Number=1.0) {
			super();
			roundRectBodyWidth = RRW;
			roundRectBodyHeight = RRH;
			ellipseWidth = EW;
			ellipseHeight = EH;
			roundRect = new RoundRectangle(roundRectBodyWidth,roundRectBodyHeight,alp,0xffffff,0,0xffffff,0,0,0,5,5);
            this.addChildAt(roundRect,0);
			fliter();
		}

		public function get bodyWidth():int{
			return(roundRect.width);
		}
		public function get bodyHeight():int{
			return(roundRect.height);
		}
		public function ChangeWidth(wid:int):void {
			this.width=wid;
		}
		public function ChangeHeight(hei:int):void {
			this.height=hei;
		}
		public function fliter() : void {
			var shadow : DropShadowFilter = new DropShadowFilter(4,60,0,1.0,20,20,1.0,3);
			roundRect.filters = [shadow];
			var filtersArray : Array = new Array(shadow);
			roundRect.filters = filtersArray;
		}
	}
}